package com.woniuxy.enjoylife.mapper;

import com.woniuxy.enjoylife.entity.Server;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.enjoylife.entity.dto.ReturnServerDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author teamEnjoyLife75
 * @since 2021-01-19
 */
@Repository
@Mapper
public interface ServerMapper extends BaseMapper<Server> {

    //查找单个
    Server selectSingle(Server o);

    //查找多个
    List<ReturnServerDto> select(Server o);

    //新增
    int insert(Server o);

    //修改
    int update(Server o);

    //删除
    int delete(Server o);


    Integer selectServerType(int id);

    String selectServerName(int id);

    Integer selectServerOwnerId(int id);

    BigDecimal selectServerPrice(int id);

    //更具价格排序
    public List<Server> sorting(@Param("sortCol") String sortCol, @Param("sort") String sort);
}
